<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="css/mui.min.css"/>
        <link rel="stylesheet" type="text/css" href="css/feedback.css" />
	</head>
	<body>

		<div id="about" class="mui-page">
			<div class="mui-navbar-inner mui-bar mui-bar-nav">
				<button type="button" class="mui-left mui-action-back mui-btn  mui-btn-link mui-btn-nav mui-pull-left">
					<span class="mui-icon mui-icon-left-nav"></span>我
				</button>
				<h1 class="mui-center mui-title">关于我们</h1>
			</div>
			<div class="mui-page-content">
				<div class="mui-scroll-wrapper">
					<div class="mui-scroll">
						<ul class="mui-table-view">
							<li class="mui-table-view-cell mui-plus-visible mui-stream-hidden">
								<a id="rate" class="mui-navigate-right">评分鼓励</a>
							</li>
							<li class="mui-table-view-cell mui-plus-visible">
								<a id="welcome" class="mui-navigate-right">欢迎页</a>
							</li>
							<li class="mui-table-view-cell mui-plus-visible" id="fenxiang">
								<a class="mui-navigate-right">分享推荐</a>
							</li>
							<li class="mui-table-view-cell" id="kefu">
								<a id="tel" class="mui-navigate-right">客服电话</a>
							</li>
							<li class="mui-table-view-cell" id="shouhou">
								<a id="feedback-btn" href="#feedback" class="mui-navigate-right">问题反馈</a>
							</li>
							<li id="check_update" class="mui-table-view-cell mui-plus-visible" id="update">
								<a  class="mui-navigate-right">检查更新</a>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</div>

		<div id="sheet1" class="mui-popover mui-popover-bottom mui-popover-action " style="margin-bottom: 15vh;">

			<ul class="mui-table-view">
				<li class="mui-table-view-cell">
					<a href="#sheet1" style="color: #222222;"><b>取消</b></a>
				</li>
			</ul>
		</div>




        <script src="js/mui.min.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript">
        	mui.init()
        </script>
        <script src="js/app.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" charset="utf-8">
			mui.plusReady(function() {
                
                
                mui("#about").on('tap','.mui-table-view-cell',function(){
                  //获取id
                  var id = this.getAttribute("id");
                  
                  //alert(id);
                  
                  switch (id){
                      case "kefu":
                      	plus.device.dial('15875394254', true);
                          break;
                      case "fenxiang":
                      plus.share.sendWithSystem({
                      	type:"web",
                      	content: "hi....",
                      	thumbs:['_www/shareLogo.png'],
                      	href: 'https://fir.im/cdqttao',
                      	title: '欢迎使用袂信！',
                      	extra: {
                      		scene: 'WXSceneSession'
                      	}
                      }, function() {
                      	console.log('分享成功');
                      }, function(e) {
                      	console.log('分享失败：' + JSON.stringify(e));
                      });
                          break;
                      case "check_update":
                      plus.nativeUI.showWaiting("等待中...");
                      setTimeout(function() {
                      	plus.nativeUI.closeWaiting();
                      	plus.nativeUI.alert("当前已是最新版本");
                      }, 2000);
                      break;
                      case "shouhou":
                      var user = app.getUserGlobalInfo();               
                      var yourFriendUsername = "cxtao";    
                      mui.ajax(app.serverUrl + "/u/search", {
                      		data: {
                                "myUserId":user.id,
                                 "friendUsername":yourFriendUsername
                            },
                      		dataType: 'json', //服务器返回json格式数据
                      		type: 'post', //HTTP请求类型
                      		timeout: 10000, //超时时间设置为10秒；
                      		headers: {
                      			'Content-Type': 'application/x-www-form-urlencoded'
                      		},
                      		success: function(data) {
                      			//服务器返回响应
                      			plus.nativeUI.closeWaiting();
                      
                      			if (data.status == 200) {
                      				var meInfo = app.getUserGlobalInfo();
                      				var x = data.data;
                      
                      				mui.ajax(app.serverUrl + "/u/addFriendRequest?myUserId=" + meInfo.id +
                      					"&friendUsername=" + x.username, {
                      						data: {},
                      						dataType: 'json', //服务器返回json格式数据
                      						type: 'post', //HTTP请求类型
                      						timeout: 10000, //超时时间设置为10秒；
                      						headers: {
                      							'Content-Type': 'application/json'
                      						},
                      						success: function(data) {
                      							//服务器返回响应
                      							plus.nativeUI.closeWaiting();
                      
                      							if (data.status == 200) {
                      
                      								plus.nativeUI.toast('已向客服发送请求消息');
                      
                      								mui.openWindow({
                      									url: "index.html",
                      									id: "index.html"
                      								});
                      							} else {
                      								app.showToast(data.msg, "error");
                      							}
                      						}
                      					});
                      
                      			} else {
                      				console.log('1');
                      				app.showToast(data.msg, "error");
                      
                      			}
                      		},
                      		error: function() {
                      			plus.nativeUI.toast(' 您已添加袂信客服');
                      		}
                      	});
                      break;
                      default:
                          break;
                  }
   
                }) 
     

			})
		</script>

	</body>

</html>
